'use strict';

var Router = require('koa-router');
var ctrl = require('./user.controller');

var accessRouter = function accessRouter(app) {
  var router = new Router({
    prefix: '/v1'
  });

  app
    .use(router.routes())
    .use(router.allowedMethods());

  router.get('/login', ctrl.checkUserAndgetToken)
    .post('/register', ctrl.register)
    .get('/check-user-name', ctrl.checkUserName);

};

module.exports = accessRouter;
